package com.wwtech.epp.ui.activity.work.module;

import com.wwtech.epp.contain.ContainValue;
import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.adapter.work.InformAdapter;
import com.wwtech.epp.ui.activity.work.InformListActivity;
import com.wwtech.epp.ui.activity.work.contract.InformListContract;
import com.wwtech.epp.ui.activity.work.presenter.InformListPresenter;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.work
 * @Description: The moduele of InformListActivity, provide field for InformListActivity
 * @date 2017/10/18 13:11:32
 */
@Module
public class InformListModule {
    private final InformListContract.View mView;


    public InformListModule(InformListContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public InformListPresenter provideInformListPresenter(HttpAPIWrapper httpAPIWrapper, InformListActivity mActivity) {
        return new InformListPresenter(httpAPIWrapper, mView, mActivity);
    }

    @Provides
    @ActivityScope
    public InformListActivity provideInformListActivity() {
        return (InformListActivity) mView;
    }

    @Provides
    @ActivityScope
    public InformAdapter provideInformAdapter() {
        return new InformAdapter(ContainValue.notice.getData());
    }
}